package com.itheima.tlias08_14;

import com.itheima.tlias08_14.entity.Department;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

import java.time.LocalDateTime;

@SpringBootApplication
@ConfigurationProperties
public class Tlias0814Application {

    public static void main(String[] args) {
        SpringApplication.run(Tlias0814Application.class, args);
    }


    /**
     * @Bean 可用于配置第三方连接信息对象
     *
     */
    @Bean(name = "dept")
    public Department test(){
        Department department = new Department();
        department.setName("计算机系");
        department.setId(1);
        department.setCreateTime(LocalDateTime.of(2020,1,1,1,1,1));
        department.setUpdateTime(LocalDateTime.of(2022,1,1,1,1,1));
        return department;
    }

}
